<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SurveyList.ascx.cs" Inherits="admin_webparts_Plug_ins_Survey_SurveyList" %>

<%@ Import Namespace="NTTHAO.Web.BL.Survey" %>
<%@ Import Namespace="NTTHAO.Common.BL" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>

<div class="tip">
	<h1><%=LanguageUtility.GetLanguageText("SURVEY_MANAGEMENT", Session)%></h1>
    <div style="display: block; width: 32px; height: 32px; float: right; position: relative; top: -27px;"><a title="<%=LanguageUtility.GetLanguageText("CLICK_RETURN", Session) %>" href="?type=<%=Request.QueryString["type"] %>"><img src="resources/images/Back.png" alt="" /></a></div>
</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
	<tr>
        <td align="left" style="padding-bottom: 10px;">
            <span id="addLink" class="yui-button yui-link-button"><span class="first-child"><a href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=surveyadd" tabindex="0" id="loggerLink-button"><%=LanguageUtility.GetLanguageText("ADD_NEW", Session)%></a></span></span>
            <script type="text/javascript">
                YAHOO.util.Event.onContentReady("addLink", function () {
                        var oAddLink = new YAHOO.widget.Button("addLink");
                    });
            </script>
        </td>
    </tr>
    <tr>
        <td align="left">
            <table border="1" cellpadding="0" cellspacing="0" class="grid" id="tbGrid">
                <tr>
                    <th width="42px">#</th>
                    <th><%=LanguageUtility.GetLanguageText("NAME", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("DESCRIPTION", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("SELECT_TYPE", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("IS_DEFAULT", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%></th>
                    <%if (Context.User.Identity.Name.Equals("admin", StringComparison.OrdinalIgnoreCase))
                    { %>
                    <th width="32px"><%=LanguageUtility.GetLanguageText("EDIT", Session)%></th>
                    <%} %>
                </tr>
                <%if (this._SurveyList != null) for (int i = 0; i < this._SurveyList.Rows.Count; i++)
                      {
                          System.Data.DataRow row = this._SurveyList.Rows[i]; %>
                <tr class="<%=(i%2==1?"even":"odd") %>">
                    <td align="center"><%=i + 1 %></td>
                    <td align="left"><a href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=surveyview&surveyid=<%=row[Survey.ID__COLUMN_NAME] %>"><b><%=row[Survey.NAME__COLUMN_NAME] %></b></a></td>
                    <td align="left"><%=row[Survey.DESCRIPTION__COLUMN_NAME] %></td>
                    <td align="center"><%=((int)row[Survey.MULTISELECT__COLUMN_NAME] == 1 ? LanguageUtility.GetLanguageText("MULTISELECT", Session) : LanguageUtility.GetLanguageText("SINGLESELECT", Session))%></td>
                    <td align="center"><%=((int)row[Survey.ISDEFAULT__COLUMN_NAME] == 1 ? "<img src=\"resources/images/active_l.png\"" : "<img src=\"resources/images/inactive_l.png\"")%></td>
                    <td align="center"><%=((int)row[Survey.ACTIVED__COLUMN_NAME] == 1 ? "<img src=\"resources/images/active_l.png\"" : "<img src=\"resources/images/inactive_l.png\"")%></td>
                    <td align="left">
                        <ul class="icon" style="width: 56px;">
                            <li><a title="<%=LanguageUtility.GetLanguageText("SET_DEFAULT", Session)%>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=setdefault&id=<%=row[Survey.ID__COLUMN_NAME] %>" class="icon activebn">&nbsp</a></li>
                            <li><a title="<%=LanguageUtility.GetLanguageText("EDIT", Session)%>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=surveyedit&id=<%=row[Survey.ID__COLUMN_NAME] %>" class="icon editbn">&nbsp</a></li>
                        </ul>
                    </td>
                </tr>
                <%} %>
            </table>
        </td>
    </tr>
</table>
